repeat console input untill non-empty password for azkabanUpload #269
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Usecase:
When user runs
gradle azkabanUploadcommand, there are two scenarios that can happen in terms of login:Since option 1 happens most of the time and command takes some time to run, user tends to press return key one or more time as soon as command is run. But when session is expired, extra return key causes empty password input and gradle task fails. For projects with complex task dependencies it can take up to 5 minutes to reach password prompt again.
Solution:
When password is empty, ask for password again. This way even with extra return keys, user will be still on password prompt.
Changes:
retryIfEmptyfor functionconsoleSecretInputofcom.linkedin.gradle.azkaban.AzkabanHelperTestclass, which is responsible for reading password input.false, to keep previous behavior ifretryIfEmptynot specified.Testing:
mock-maker-inlineextension enabled. This extenstion is required because we need to mockConsoleclass which is final class(reference). However, adding this extension caused other testcase failures(13 test out of total 49). For now keeping this unit test commented, but I would love to hear comments on this.gradle azkabanUploadcommand.